package com.manner.groupon.utils;


import java.math.BigDecimal;

/**
 * @Author: Manner
 * @Description: 转换为BigDecimal类型工具类
 * @DateTime: 2024/11/11 5:38
 */
public class BigDecimalUtils {

    /**
     * @param number
     * @return BigDecimal
     * @description:转换为2位小数
     * @author Manner
     * @date 2024/11/11 5:41
     */
    public static BigDecimal convertTwoRate(Object number) {
        BigDecimal profitRate = new BigDecimal(number.toString())
                .divide(
                        new BigDecimal(100),
                        2,
                        BigDecimal.ROUND_HALF_UP
                );
        return profitRate;
    }
}
